// 文件路径: src/main/java/com/chixing/controller/UserCouponController.java

package com.chixing.controller;

import com.chixing.entity.UserCoupon;
import com.chixing.service.IUserCouponService;
import com.chixing.util.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.time.LocalDateTime;
import java.util.List;

/**
 * <p>
 * 用户优惠券前端控制器
 * </p>
 *
 * @author liwenjing
 * @since 2025-10-07
 */
@RestController
@RequestMapping("/userCoupon")
public class UserCouponController {

    @Autowired
    private IUserCouponService userCouponService;
//  领取优惠券

    @PostMapping
    public Result save(
            @RequestBody UserCoupon userCoupon) {
        System.out.println(userCoupon);


        return userCouponService.saveCoupon(userCoupon);
    }

    @GetMapping("userId/{userId}/status/{mycouponStatus}")
    public Result getMyAllCoupons(@PathVariable("userId") Integer userId,
                                  @PathVariable("mycouponStatus") Integer mycouponStatus) {
        return userCouponService.getMyAllCoupons(userId, mycouponStatus);
    }


}



